<form action="" class="form-horizontal" role="form">
	<div class="form-group">
	    <label class="col-sm-2 control-label">文章名称</label>
	    <div class="col-sm-4">
	    	<input type="text" class="form-control" name="name" placeholder="" datatype="*"/>
	    </div>
	</div>
	
	<div class="form-group">
	    <label class="col-sm-2 control-label">文章概要</label>
	    <div class="col-sm-6">
	    	<input type="text" class="form-control" name="brief" placeholder="" datatype="*"/>
	    </div>
	</div>
	
	<div class="form-group">
	    <label class="col-sm-2 control-label">文章标签</label>
	    <div class="col-sm-4">
	    	<input type="text" class="form-control" name="tags" placeholder=""/>
	   		<span class="label label-info">多个标签请使用英文逗号,分割</span>
	    </div>
	</div>
	
	<div class="form-group">
		<label class="col-sm-2 control-label">文章缩略图</label>
	    <div class="col-sm-6">
	    	<input type="text" class="form-control margin-bottom" disabled name="pic" id="pic" placeholder=""/>
	   		<input type="file" name="file_upload" id="image_upload" />
	    </div>
	</div>
	
	<div class="form-group">
	    <label class="col-sm-2 control-label">文章内容</label>
	    <div class="col-sm-6">
	    	<script id="content" type="text/plain"></script>
	    </div>
	</div>

	<div class="form-group">
		<div class="col-sm-offset-2 col-sm-8">
			<input type="hidden" name="category" value="{$_GET['cat_id']}"/>
			<button type="submit" class="btn btn-primary submit" data-loading-txt="提交中，请稍后……" data-ajax-url="__CONTROLLER__/addPost">保存更改</button>
		</div>
	</div>
</form>

<!-- uploadify -->
<link rel="stylesheet" href="__PUBLIC__/Style/Common/uploadify/uploadify.css">
<script type="text/javascript" src="__PUBLIC__/Style/Common/uploadify/jquery.uploadify.min.js?{:rand(0,9999)}"></script>
<script type="text/javascript">
$(function() {
	var category = {$_GET['cat_id']};
    $("#image_upload").uploadify({
        'multi'			:	false,
        'fileSizeLimit' : 	'200kb',
        'buttonText'	:	'选择图片',
        'fileTypeDesc' 	: 	'Image Files',
        'fileTypeExts' 	: 	'*.jpg; *.png',
        'swf'			: 	'__PUBLIC__/Style/Common/uploadify/uploadify.swf',
        'uploader'		: 	'__CONTROLLER__/upload',
        'formData'		:	{cat_id: category},
        'onUploadSuccess'	: function(data, res){
        	
        	var url = eval("(" + res + ")").extra.url;
        	$("#pic").val( url );
        	
        }
    });
});
</script>
<!-- ueditor -->
<link rel="stylesheet" href="/ue/themes/default/css/ueditor.min.css">
<script type="text/javascript" src="/ue/ueditor.config.js"></script>
<script type="text/javascript" src="/ue/ueditor.all.js"></script>
<script type="text/javascript">
	window.UEDITOR_HOME_URL = "/ue/";
    var editor = UE.getEditor("content",{
    	initialFrameWidth: "100%",
	    initialFrameHeight: 300,
	    textarea: "content"
    });
    
</script>